package com.shou.service;

import com.shou.mapper.TeacherMapper;
import com.shou.pojo.Teacher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
public class TeacherServiceImpl implements TeacherService {

    @Autowired
    private TeacherMapper teacherMapper;

    @Override
    public List<Teacher> getTeachersByActivity(int activityId) {
        return teacherMapper.getTeachersByActivity(activityId);
    }

    @Override
    @Transactional
    public void confirmEnrollment(int studentId, int activityId) {
        // 一系列业务逻辑
        // ...

        // 确认活动人员的参与
        teacherMapper.confirmEnrollment(studentId, activityId);

        // 其他业务逻辑
        // ...
    }

    @Override
    @Transactional
    public void confirmDailyTask(int studentId, int taskId) {
        // 一系列业务逻辑
        // ...

        // 确认日常任务完成情况
        teacherMapper.confirmDailyTask(studentId, taskId);

        // 其他业务逻辑
        // ...
    }

    @Override
    @Transactional
    public void updatePersonalInfo(int teacherId, String name, int age) {
        // 一系列业务逻辑
        // ...

        // 更新教师个人信息
        teacherMapper.updatePersonalInfo(teacherId, name, age);

        // 其他业务逻辑
        // ...
    }

    // 其他业务逻辑方法...
}

